var colors = [0xFF504C,0x935EFF,0x66FF70,0x89D3FF,0xF5F97A,0xFF973E];
class Tile extends egret.DisplayObjectContainer
{
    public label: egret.TextField;
    public circle: egret.Shape;
    public color;
    static size = 20;
    public constructor(text = "U",color = 0xff0000)
    {
        super();
        this.color = color;
        this.circle = new egret.Shape;
        this.addChild(this.circle);
        this.label = new egret.TextField;
        this.label.size = Tile.size+5;
        this.label.fontFamily = "微软雅黑";
        this.label.text = text;
        this.label.anchorY = this.label.anchorX = 0.5;
        this.unlight();
        this.addChild(this.circle);
        this.addChild(this.label);
    }
    public light()
    {
        this.circle.graphics.beginFill(this.color);
        this.drawCircle();
        //this.scaleX = this.scaleY = 1.2;
        //EffectUtils.shake(this);
        this.label.textColor = 0;
    }
    public unlight()
    {
        this.scaleX = this.scaleY = 1;
        this.circle.graphics.clear();
        this.circle.graphics.lineStyle(2,this.color);
        this.drawCircle();
        this.label.textColor = this.color;
    }
    public drawCircle()
    {
        this.circle.graphics.drawCircle(0,0,Tile.size);
    }
}